/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.cars;

import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelFields;
import com.jeesite.common.utils.excel.fieldtype.CompanyType;
import com.jeesite.common.utils.excel.fieldtype.OfficeType;
import com.jeesite.common.utils.excel.fieldtype.TcarType;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import javax.validation.Valid;

/**
 * 车辆档案Entity
 * @author shengbin
 * @version 2021-03-01
 */
@Table(name="t_car_configuration", alias="a", columns={
		@Column(name="configuration_id", attrName="configurationId", label="配置ID", isPK=true),
		@Column(name="optional_configuration_item", attrName="optionalConfigurationItem", label="可选配置项目"),
		@Column(name="english_name", attrName="englishName", label="英文名称", queryType=QueryType.LIKE),
		@Column(name="code", attrName="code", label="编码"),
		@Column(name="price", attrName="price", label="价格"),
		@Column(name="car_id", attrName="carId.carId", label="车辆ID"),
	}, orderBy="a.configuration_id ASC"
)
public class TcarConfiguration extends DataEntity<TcarConfiguration> {

	private static final long serialVersionUID = 1L;
	private String configurationId;		// 配置ID
	private String optionalConfigurationItem;		// 可选配置项目
	private String englishName;		// 英文名称
	private String code;		// 编码
	private Double price;		// 价格
	private Tcar carId;		// 车辆ID 父类

	public TcarConfiguration() {
		this(null);
	}


	public TcarConfiguration(Tcar carId){
		this.carId = carId;
	}
	@Valid
	@ExcelFields({
			@ExcelField(title="车辆编号", attrName="carId", align= ExcelField.Align.CENTER, sort=10, fieldType= TcarType.class),
			@ExcelField(title="可选配置项目", attrName="optionalConfigurationItem", align = ExcelField.Align.CENTER, sort=20),
			@ExcelField(title="英文名称", attrName="englishName", align= ExcelField.Align.CENTER, sort=30),
			@ExcelField(title="编码", attrName="code", align= ExcelField.Align.CENTER, sort=40),
			@ExcelField(title="价格", attrName="price", align= ExcelField.Align.LEFT, sort=50),
	})
	public String getConfigurationId() {
		return configurationId;
	}

	public void setConfigurationId(String configurationId) {
		this.configurationId = configurationId;
	}
	
	@Length(min=0, max=100, message="可选配置项目长度不能超过 100 个字符")
	public String getOptionalConfigurationItem() {
		return optionalConfigurationItem;
	}

	public void setOptionalConfigurationItem(String optionalConfigurationItem) {
		this.optionalConfigurationItem = optionalConfigurationItem;
	}
	
	@Length(min=0, max=100, message="英文名称长度不能超过 100 个字符")
	public String getEnglishName() {
		return englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}
	
	@Length(min=0, max=100, message="编码长度不能超过 100 个字符")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	public Tcar getCarId() {
		return carId;
	}

	public void setCarId(Tcar carId) {
		this.carId = carId;
	}
	
}